<?php
// no direct access
defined('_JEXEC') or die('Restricted access');

$user= &JFactory::getUser();
JHTML::stylesheet('base.css', JURI::root().'/components/com_simplelisting/css/');
?>

<div id="cpanel" style="float:left;width:60%;">
 
	<div style="float:left;">
    	<div class="icon">
	    	<a href="index.php?option=com_simplelisting&amp;controller=listings">
                    <img alt="<?php echo JText::_('TITLE_MANAGER'); ?>" src="components/com_simplelisting/assets/img/simplelisting-48.png" />
                    <span><?php echo JText::_('TITLE_MANAGER'); ?></span>
	    	</a>
    	</div>
  	</div>
 
	<div style="float:left;">
    	<div class="icon">
	    	<a href="index.php?option=com_simplelisting&controller=fields">
                    <img alt="<?php echo JText::_('TITLE_FIELDS'); ?>" src="components/com_simplelisting/assets/img/simplelisting-48-f.png" />
                    <span><?php echo JText::_('TITLE_FIELDS'); ?></span>
	    	</a>
    	</div>
  	</div>
  
  	<div style="float:left;">
    	<div class="icon">
	    	<a href="index.php?option=com_config&amp;controller=component&amp;component=com_simplelisting&amp;path=" class="modal" rel="{handler: 'iframe', size: {x: 600, y: 600}}">
                    <img alt="<?php echo JText::_('TITLE_CONFIG'); ?>" src="components/com_simplelisting/assets/img/simplelisting-48.png" />
                    <span><?php echo JText::_('TITLE_CONFIG'); ?></span>
	    	</a>
    	</div>
  	</div>

      	<div style="float:left;">
    	<div class="icon">
	    	<a href="index.php?option=com_simplelisting&view=languages">
                    <img alt="<?php echo JText::_('TITLE_TRANSLATION'); ?>" src="components/com_simplelisting/assets/img/simplelisting-48.png" />
                    <span><?php echo JText::_('TITLE_TRANSLATION'); ?></span>
	    	</a>
    	</div>
  	</div>

      	<div style="float:left;">
    	<div class="icon">
	    	<a href="index.php?option=com_simplelisting&amp;view=help">
                    <img alt="<?php echo JText::_('TITLE_HELP'); ?>" src="components/com_simplelisting/assets/img/simplelisting-48.png" />
                    <span><?php echo JText::_('TITLE_HELP'); ?></span>
	    	</a>
    	</div>
  	</div>

	<div class="clr"></div>
</div>

<div id="tabs" style="float:right; width:40%;">

 	<?php
	jimport('joomla.html.pane');
	
	$pane =& JPane::getInstance('Tabs');
	
	echo $pane->startPane('simplelistingPane');
	
				echo $pane->startPanel(JText::_('TAB_LATEST_ENTRIES'), 'itemstab');

			echo "<div>";

				$rows = &$this->latestEntries;

				echo "<table class='cw_listing'>";


    				echo "<thead>";

      					echo "<tr>";

      						echo "<th width='4%'>";
      							echo JText::_('LABEL_POSTED_DATE');
      						echo "</th>";

                                                echo "<th width='10%'>";
      							echo JText::_('LABEL_CONTACT_NAME');
      						echo "</th>";

      						echo "<th width='20%'>";
      							echo JText::_('LABEL_NAME');
      						echo "</th>";

                                                echo "<th width='10%'>";
      							echo JText::_('LABEL_CATEGORY');
      						echo "</th>";

      						echo "<th width='2%'>";
      							echo JText::_('LABEL_PUBLISHED');
      						echo "</th>";

      					echo "</tr>";

    				echo "</thead>";

    				echo "<tbody>";

					foreach ( $rows as $row) {

						$link = JRoute::_( 'index.php?option=com_simplelisting&controller=listings&task=edit&cid[]='. $row->id );

						?>

						<tr class="<?php echo "row$k"; ?>">
                                                    <?php
							echo "<td>".$_entrydate = str_replace( " ", "&nbsp;", $row->entrydate)."</td>";

                                                        echo "<td>".$row->username."</td>";


							echo "<td><a href='" . $link . "'>".$row->name."</a></td>";

                                                        echo "<td>".$row->category."</td>";


							echo "<td>"?><?php
                                                        if ( $row->published) {
									echo "<img src='/administrator/images/tick.png' width='16px' height='16px' />";
								}
								else {
									echo "<img src='/administrator/images/publish_x.png' width='16px' height='16px' />";
								}
							
							"</td>";

                                                        ?>
						</tr>

						<?php
					}

					echo "</tbody>";

				echo "</table>";

			echo "</div>";
                        echo $pane->endPanel();
	
                    echo $pane->startPanel( JText::_('TAB_STATS') , 'statisticstab' );
			?>
                    <table class="general_fields">
                        <tr>
                            <td>
                                <table>
                                <?php
                                    if($Listings = $this->getListings('simplelisting'))
                                    {
                                    echo '<tr><td class="label">'. JText::_('LABEL_LISTINGS').': </td><td class="content">'.$Listings.'</td></tr>';
                                    }else{
                                    echo '<tr><td class="label">'. JText::_('LABEL_LISTINGS').': </td><td class="content" style="color:#F08433">'. JText::_('NO_STATS_MSG').'</td></tr>';
                                    }
                                    ?>
                                    <?php
                                    if($Categories = $this->getTotals('categories'))
                                    {
                                    echo '<tr><td class="label">'. JText::_('LABEL_CATEGORIES').': </td><td class="content">'.$Categories.'</td></tr>';
                                    }else{
                                    echo '<tr><td class="label">'. JText::_('LABEL_CATEGORIES').': </td><td class="content" style="color:#F08433">'. JText::_('NO_STATS_MSG').'</td></tr>';
                                    }
                                    ?>
                                    <?php
                                    if($Types = $this->getTotals('types'))
                                    {
                                    echo '<tr><td class="label">'. JText::_('LABEL_TYPES').': </td><td class="content">'.$Types.'</td></tr>';
                                    }else{
                                    echo '<tr><td class="label">'. JText::_('LABEL_TYPES').': </td><td class="content" style="color:#F08433">'. JText::_('NO_STATS_MSG').'</td></tr>';
                                    }
                                    ?>
                                    <?php
                                    if($Countries = $this->getTotals('countries'))
                                    {
                                        echo '<tr><td class="label">'. JText::_('LABEL_COUNTRIES').': </td><td class="content">'.$Countries.'</td></tr>';
                                    } else {
                                    echo '<tr><td class="label">'. JText::_('LABEL_COUNTRIES').': </td><td class="content" style="color:#F08433">'. JText::_('NO_STATS_MSG').'</td></tr>';
                                    }
                                    ?>
                                    <?php
                                    if($Extras = $this->getTotals('extras'))
                                    {
                                    echo '<tr><td class="label">'. JText::_('LABEL_EXTRAS').': </td><td class="content">'.$Extras.'</td></tr>';
                                    }else{
                                    echo '<tr><td class="label">'. JText::_('LABEL_EXTRAS').': </td><td class="content" style="color:#F08433">'. JText::_('NO_STATS_MSG').'</td></tr>';
                                    }
                                    ?>
                                    <?php
                                    if($Facilities = $this->getTotals('facilities'))
                                    {
                                    echo '<tr><td class="label">'. JText::_('LABEL_FACILITIES').': </td><td class="content">'.$Facilities.'</td></tr>';
                                    }else{
                                    echo '<tr><td class="label">'. JText::_('LABEL_FACILITIES').': </td><td class="content" style="color:#F08433">'. JText::_('NO_STATS_MSG').'</td></tr>';
                                    }
                                    ?>

                                </table>
                            </td>
                        </tr>
                    </table>
                <?php
                echo $pane->endPanel();

		echo $pane->startPanel(JText::_('TAB_ABOUT'), 'abouttab');
                ?>
                <div style="text-align:center">
                    <div class="icon">
                        <a href="http://celtaweb.net">
                            <img src="components/com_simplelisting/assets/img/CeltaWeb.png" height="128" alt="CeltaWeb" />
                        </a>
                    </div>
                    <div style="margin: 10px 0px 0px 0px">
                        <h1>Simplelisting</h1>
                    </div>
                    <div>
                         <h2>A complete listing solution</h2>
                        <p>A Joomla listing application that can be administered both through the front and back end allowing users to easily list items both quickly and with tonnes of flexibility.</p>
                        <h2>Online Documentation</h2>
                        <p><a href="http://celtaweb.net">English</a></p>
                        <h2>Support Simple Listings</h2>
                        <p>If you like this component please rate it at the Joomla Extensions Directory. </p>
                        <h2>Copyright</h2>
                        <p>Simple Listings is free software released under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU/GPL License v3</a>. Copyright 2011 Steven Palmer</p>
                    </div>
                </div>
		<?php
		echo $pane->endPanel();
            echo $pane->endPane();
	?>
</div>
<div class="clr"></div>





